// 公共
using Unity.Netcode;
using UnityEngine;

public partial class Player : NetworkBehaviour
{
    private NetVaribale<PlayerState> currentState = new NetVaribale<PlayerState>(PlayerState.None);
    public override void OnNetworkSpawn()
    {
        base.OnNetworkSpawn();

        if (IsClient)
        {

            Client_OnNetworkSpawn();

        }
        else
        {

            Server_OnNetworkSpawn();

        }
    }

    public override void OnNetworkDespawn()
    {
        if (IsClient)
        {

        }
        else
        {

            Server_OnNetworkDespawn();

        }
    }

    // 相当于调用服务端上自身的本体
    [ServerRpc(RequireOwnership = false)]
    private void SendInputMoveDirServerRpc(Vector3 moveDir)
    {
        Server_ReceiveMoveInput(moveDir);

    }
}